package com.antdesignbackend.backend.service.impl;

import com.antdesignbackend.backend.entity.Egg;
import com.antdesignbackend.backend.entity.entityVo.EggVo;
import com.antdesignbackend.backend.mapper.EggMapper;
import com.antdesignbackend.backend.service.EggService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EggServiceImpl extends ServiceImpl<EggMapper, Egg> implements EggService {
    @Autowired
    EggMapper eggMapper;

    @Override
    public List<EggVo> search(@Param(Constants.WRAPPER) QueryWrapper<EggVo> eggVoQueryWrapper, Page<EggVo> page){
        return eggMapper.search(eggVoQueryWrapper,page);
    };
    @Override
    public Integer count(@Param(Constants.WRAPPER) QueryWrapper<EggVo> queryWrapper){
        return  eggMapper.count(queryWrapper);
    };
}
